package com.dify.config;


import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;


import java.time.Duration;


@Configuration
public class WebFluxConfig {


        @Bean
        public RestTemplate restTemplate(RestTemplateBuilder builder) {
            return builder
                    .setConnectTimeout(Duration.ofMinutes(5)) // 设置连接超时为5分钟
                    .setReadTimeout(Duration.ofMinutes(5))    // 设置读取超时为5分钟
                    .build();
        }

    @Bean
    public WebClient webClient() {
        return WebClient.create();
    }




}